package com.ruoyi.inducePest.service.inducePest;


import com.drew.imaging.ImageProcessingException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.inducePest.domain.InduceDetectionLog;
import com.ruoyi.inducePest.domain.inducePest.InducePestImgInfo;
import com.ruoyi.inducePest.domain.inducePest.SelectInducePestImgInfo;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.text.ParseException;
import java.util.Date;
import java.util.List;

/**
 * @author DELL
 */

public interface InducePestCaptureImgService {


    /**
     * 前端调用接口
     * @param inducePestImgInfo
     * @return
     */
    public TableDataInfo getInfoByCondition(SelectInducePestImgInfo inducePestImgInfo, Integer pageNum, Integer pageSize) throws JsonProcessingException;

    /**
     * 上传多张图片
     *
     */
    public List<InduceDetectionLog> insertInfoForMultipartFile(MultipartFile[] files) throws ImageProcessingException, IOException, ParseException;

    /**
     * 上传单张图片和详细信息
     *
     */
    public List<InduceDetectionLog> insertInfoForSingleDetail(MultipartFile file, InducePestImgInfo inducePestImgInfo) throws ImageProcessingException, IOException, ParseException;

    /**
     * 模型检测，供其他方法使用
     * @param file
     * @param inducePestImgInfo
     * @return
     * @throws IOException
     * @throws ImageProcessingException
     * @throws ParseException
     */
    public List<InduceDetectionLog> inducePestModelDetection(MultipartFile file,InducePestImgInfo inducePestImgInfo) throws IOException, ImageProcessingException, ParseException;

    /**
     * 根据ID更新重新计数的内容

     * @return
     */
    public List<InduceDetectionLog> autoCountAgain(Integer id) throws JsonProcessingException;

    /**
     * 根据id更改板的状态
     *
     * @return
     */
    public Integer updateBoard(Integer id,Integer isNewBoard);

    /**
     * 根据id更改tag标签，添加tagManual
     *
     * @return
     */
    public Integer updateTagManual(Integer id,Integer dm,Integer ehm,Integer dzjym,Integer cdtye,Integer ymm);

    /**
     * 从OSS拉取前一天的图片
     */
    public List<InduceDetectionLog> downImageFromOSSAuto() throws ParseException;

    /**
     * 从OSS拉取指定时间内的图片
     */
    public List<InduceDetectionLog> downImageFromOSSAutoByTime(String beginDay,String endDay) throws ParseException;

    /**
     * 从OSS拉取指定时间内指定设备的图片
     */
    public List<InduceDetectionLog> downImageFromOSSByTimeAndDeviceId(Integer deviceId, String beginDay,String endDay);


    /**
     * 从OSS拉取图片
     * @param beginTime
     * @param endTime
     * @return
     */
    public  List<InduceDetectionLog> getImageFromOSSByTime(Date beginTime, Date endTime,Integer isCaptureManual);

    /**
     * 删除数据
     *
     */
    public Integer deleteImgInfo(int id);

    /**
     * 更新绘图信息以及虫子信息
     *
     */
    public InducePestImgInfo drawByManual(Integer id,String width,String height,String type,String position, Integer addOrCut) throws IOException;

    List<String> getPestTypeInfoByCondition(SelectInducePestImgInfo inducePestImgInfo);

    void draw(String tag, String imgPath,String corner,String imgPest);
}
